package com.bingo.mpa.pojo;

import java.util.Map;

import org.apache.commons.beanutils.BeanUtils;
import org.express.portal.persist.POJO;

public class User extends POJO
{
	private static final long serialVersionUID = 1L;
	private long uid;
	private long aid;
	private long sid;
	private String account;
	private String name;
	private String pwd;
	private String msn;
	private int qq;
	private String mobile;
	private String email;
	private byte gender;
	private java.sql.Timestamp birth;
	private String province;
	private String city;
	private String address;
	private String postcode;
	private byte role;
	private byte status;
	private int online;
	private String token;
	private java.sql.Timestamp reg_time;
	private java.sql.Timestamp this_login_time;
	private String this_login_ip;
	private java.sql.Timestamp last_login_time;
	private String last_login_ip;
	private byte error_count;
	
	public User()
	{
		super._this_table_name = "P_USER";
		this.status = 1;
	}
	
	public long getUid()
	{
		return uid;
	}

	public void setUid(long uid)
	{
		this.uid = uid;
	}

	public long getAid()
	{
		return aid;
	}

	public void setAid(long aid)
	{
		this.aid = aid;
	}

	public long getSid()
	{
		return sid;
	}

	public void setSid(long sid)
	{
		this.sid = sid;
	}

	public String getAccount()
	{
		return account;
	}

	public void setAccount(String account)
	{
		this.account = account;
	}

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public String getPwd()
	{
		return pwd;
	}

	public void setPwd(String pwd)
	{
		this.pwd = pwd;
	}

	public String getMsn()
	{
		return msn;
	}

	public void setMsn(String msn)
	{
		this.msn = msn;
	}

	public int getQq()
	{
		return qq;
	}

	public void setQq(int qq)
	{
		this.qq = qq;
	}

	public String getMobile()
	{
		return mobile;
	}

	public void setMobile(String mobile)
	{
		this.mobile = mobile;
	}

	public String getEmail()
	{
		return email;
	}

	public void setEmail(String email)
	{
		this.email = email;
	}

	public byte getGender()
	{
		return gender;
	}

	public void setGender(byte gender)
	{
		this.gender = gender;
	}

	public java.sql.Timestamp getBirth()
	{
		return birth;
	}

	public void setBirth(java.sql.Timestamp birth)
	{
		this.birth = birth;
	}

	public String getProvince()
	{
		return province;
	}

	public void setProvince(String province)
	{
		this.province = province;
	}

	public String getCity()
	{
		return city;
	}

	public void setCity(String city)
	{
		this.city = city;
	}

	public String getAddress()
	{
		return address;
	}

	public void setAddress(String address)
	{
		this.address = address;
	}

	public String getPostcode()
	{
		return postcode;
	}

	public void setPostcode(String postcode)
	{
		this.postcode = postcode;
	}

	public byte getRole()
	{
		return role;
	}

	public void setRole(byte role)
	{
		this.role = role;
	}

	public byte getStatus()
	{
		return status;
	}

	public void setStatus(byte status)
	{
		this.status = status;
	}

	public int getOnline()
	{
		return online;
	}

	public void setOnline(int online)
	{
		this.online = online;
	}

	public String getToken()
	{
		return token;
	}

	public void setToken(String token)
	{
		this.token = token;
	}

	public java.sql.Timestamp getReg_time()
	{
		return reg_time;
	}

	public void setReg_time(java.sql.Timestamp reg_time)
	{
		this.reg_time = reg_time;
	}

	public java.sql.Timestamp getThis_login_time()
	{
		return this_login_time;
	}

	public void setThis_login_time(java.sql.Timestamp this_login_time)
	{
		this.this_login_time = this_login_time;
	}

	public String getThis_login_ip()
	{
		return this_login_ip;
	}

	public void setThis_login_ip(String this_login_ip)
	{
		this.this_login_ip = this_login_ip;
	}

	public java.sql.Timestamp getLast_login_time()
	{
		return last_login_time;
	}

	public void setLast_login_time(java.sql.Timestamp last_login_time)
	{
		this.last_login_time = last_login_time;
	}

	public String getLast_login_ip()
	{
		return last_login_ip;
	}

	public void setLast_login_ip(String last_login_ip)
	{
		this.last_login_ip = last_login_ip;
	}

	public byte getError_count()
	{
		return error_count;
	}

	public void setError_count(byte error_count)
	{
		this.error_count = error_count;
	}

	@SuppressWarnings("unchecked")
	protected Map<String, Object> listInsertableFields()
	{
		try
		{
			Map<String, Object> props = BeanUtils.describe(this);
			if (getId() <= 0)
			{
				if(props.containsKey("id"))
				{
					props.remove("id");
				}
				if(props.containsKey("uid"))
				{
					props.remove("uid");
				}
			}
			props.remove("class");
			return props;
		}
		catch (Exception e)
		{
			throw new RuntimeException("Exception when Fetching fields of " + this);
		}
	}
}
